package com.stlm2.dems.dao.impl;

import com.stlm2.util.MapUtil;
import org.springframework.stereotype.Repository;

import com.stlm2.dems.entity.DdmGoodPropertyRelation;
import com.stlm2.dems.dao.DdmGoodPropertyRelationDao;
import com.stlm2.core.base.impl.BaseDaoImpl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository("ddmGoodPropertyRelationDao")
public class DdmGoodPropertyRelationDaoImpl extends BaseDaoImpl<DdmGoodPropertyRelation> implements DdmGoodPropertyRelationDao {
    @Override
    public List<DdmGoodPropertyRelation> getByGoodsId(int goodsId) {
        return selectList("getByGoodsId",goodsId);
    }

    @Override
    public DdmGoodPropertyRelation getRelation(Integer propertyId, Integer goodsId) {
        Map<String,Object> map=new HashMap<String, Object>();
        map.put("propertyId",propertyId);
        map.put("goodsId",goodsId);
        return selectOne("getRelation",map);
    }
}